package nc.tb.app.adjustbill.ui;

import nc.tb.app.vo.IAdjustBillStatus;
import nc.ui.trade.base.AbstractBillUI;
import nc.ui.trade.businessaction.BusinessAction;
import nc.vo.pub.AggregatedValueObject;

public class AdjustBillBusinessAction extends BusinessAction{
	
	public AdjustBillBusinessAction() {
		super();
	}

	public AdjustBillBusinessAction(AbstractBillUI ui) {
		super(ui);
	}

	protected void setBillStatus(AggregatedValueObject billvo) {
		Integer billstatus = (Integer) billvo.getParentVO().getAttributeValue(getUI().getBillField().getField_BillStatus());

		if (billstatus == null || billstatus.intValue() == IAdjustBillStatus.NOPASS || billstatus.intValue() == IAdjustBillStatus.DELETE) {
			billvo.getParentVO().setAttributeValue(getUI().getBillField().getField_CheckMan(), null);
			billvo.getParentVO().setAttributeValue(getUI().getBillField().getField_CheckDate(), null);
			billvo.getParentVO().setAttributeValue(getUI().getBillField().getField_CheckNote(), null);
			billvo.getParentVO().setAttributeValue(getUI().getBillField().getField_BillStatus(), new Integer(IAdjustBillStatus.FREE));
		}

	}
	
}
